home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / TIPS / CURSOR.PAS < prev    next >
Pascal/Delphi Source File  |  1991-10-09  |  1KB  |  50 lines

  1. {************************************************}
  2. {                                                }
  3. {   Turbo Pascal for Windows                     }
  4. {   Tips & Techniques Demo Program               }
  5. {   Copyright (c) 1991 by Borland International  }
  6. {                                                }
  7. {************************************************}
  8.  
  9. program Cursor;
  10.  
  11. uses WinTypes, WinProcs, WObjects;
  12.  
  13. type
  14.   TApp = object(TApplication)
  15.     procedure InitMainWindow; virtual;
  16.   end;
  17.  
  18.   PMyWindow = ^TMyWindow;
  19.   TMyWindow = object(TWindow)
  20.     function  GetClassName: PChar; virtual;
  21.     procedure GetWindowClass(var AWndClass: TWndClass); virtual;
  22.   end;
  23.  
  24. procedure TApp.InitMainWindow;
  25. begin
  26.   MainWindow := New(PMyWindow, Init(Nil, 'Cross'));
  27. end;
  28.  
  29.  
  30. function TMyWindow.GetClassName: PChar;
  31. begin
  32.   GetClassName := 'CrossCursorDemoWindow';
  33. end;
  34.  
  35.  
  36. procedure TMyWindow.GetWindowClass(var AWndClass: TWndClass);
  37. begin
  38.   TWindow.GetWindowClass(AWndClass);
  39.   AWndClass.HCursor := LoadCursor(HWindow, idc_Cross);
  40. end;
  41.  
  42. var
  43.   App: TApp;
  44.  
  45. begin
  46.   App.Init('Cross');
  47.   App.Run;
  48.   App.Done;
  49. end.
  50.